package com.toycloud.business.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.toycloud.common.excel.converter.*;
import com.toycloud.common.utils.StringToListJsonTypeHandler;
import com.toycloud.common.utils.StringToListTypeHandler;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * demand视图对象 demand_record
 *
 * @author binlu6
 * @date 2024-10-31
 */
@Data
@ExcelIgnoreUnannotated
public class SaleVo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
//    @ExcelProperty(value = "需求id")
    private Integer id;

    /**
     * 需求id
     */
    @ExcelProperty(value = "需求id")
    private Integer demandId;

    /**
     * 需求标题
     */
    @ExcelProperty(value = "需求标题")
    private String demandTitle;

    /**
     * 需求描述
     */
    @ExcelProperty(value = "需求描述")
    private String demandContent;

    /**
     * 应用标签
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> applicationLabel;

    /**
     * 需求版本
     */
    @ExcelProperty(value = "需求版本")
    private String demandVersion;

    /**
     * 应用标签
     */
    @ExcelProperty(value = "应用标签", converter = ListToStringConverter.class)
    private List<String> applicationLabelName;



    /**
     * 需求来源
     */
//    @ExcelProperty(value = "需求来源",converter = ListToStringConverter.class)
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String>  demandResource;

    /**
     * 需求来源
     */
    @ExcelProperty(value = "需求来源",converter = ListToStringConverter.class)
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String>  demandResourceName;

    /**
     * 需求类型
     */
//    @ExcelProperty(value = "需求类型",converter = ListToStringConverter.class)
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> demandType;

    /**
     * 需求类型
     */
    @ExcelProperty(value = "需求类型", converter = DemandTypeConverter.class)
    @TableField(typeHandler = JacksonTypeHandler.class)
    private String demandTypeName;

    /**
     * 需求人
     */
    @ExcelProperty(value = "需求人")
    private String demandPerson;

    /**
     * 提出时间
     */
    @ExcelProperty(value = "提出时间")
    private Date proposeTime;

    /**
     * 当前状态
     */
    @ExcelProperty(value = "需求阶段",converter = NowStatusConverter.class)
    private String nowStatus;




    /**
     * 需求优先级（0S,1A,2B,3C,4D）
     */
    @ExcelProperty(value = {"需求筛选", "优先级"}, converter = FilterLevelConverter.class)
    private String filterLevel;

    /**
     * 开发总结
     */
//    @ExcelProperty(value = "总结")
    private String developSum;



    /**
     * 场景标签
     */
    @ExcelProperty(value = {"需求调研", "场景标签"})
    private String sceneLabel;


    /**
     * 场景说明
     */
    @ExcelProperty(value = {"需求调研", "场景说明"})
    private String sceneDescribe;

    /**
     * 需求价值
     */
    @ExcelProperty(value = {"需求调研", "需求价值"})
    private String demandValue;

    /**
     * 用户范围
     */
    @ExcelProperty(value = {"需求调研", "影响用户范围"})
    private String userScope;

    /**
     * 现有解决方案
     */
    @ExcelProperty(value = {"需求调研", "现有解决方案"})
    private String existingSolution;

    /**
     * 期望解决方案
     */
    @ExcelProperty(value = {"需求调研", "期望解决方案"})
    private String expectedSolution;

    /**
     * 调研其他
     */
    @ExcelProperty(value = {"需求调研", "其他"})
    private String surveyRemark;

    /**
     * 调研状态（0未完成,1已完成）
     */
    @ExcelProperty(value = {"需求调研", "状态"}, converter = ReviewStatusConverter.class)
    private String surveyStatus;

    /**
     * 调研参与人
     */
    @ExcelProperty(value = {"需求调研", "调研参与人"})
    private String surveyPerson;

    /**
     * 调研更新时间
     */
    @ExcelProperty(value = {"需求调研", "最近更新时间"})
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime surveyUpdateTime;


    /**
     * 上市数据说明
     */
    @ExcelProperty(value = {"上市验证", "数据说明"})
    private String saleSum;

    /**
     * 用户反馈标签
     */
    @TableField(typeHandler = StringToListTypeHandler.class)
    private List<String> productLabel;


    /**
     * 用户反馈标签
     */
    @ExcelProperty(value ={"上市验证", "用户反馈标签"}, converter = ListToStringConverter.class)
    private List<String> productLabelName;


    /**
     * 需求状态（0未筛选,1正常推进,2已挂起,3已关闭,4已变更）
     */
//    @ExcelProperty(value = "需求状态", converter = DemandStatusConverter.class)
    private String filterStatus;




    /**
     * 发布总结
     */
//    @ExcelProperty(value = "总结")
    private String releaseSum;

    /**
     * 发布状态（0未完成,1已完成）
     */
//    @ExcelProperty(value = "状态", converter = ReviewStatusConverter.class)
    private String releaseStatus;

    /**
     * 发布参与人
     */
//    @ExcelProperty(value = "参与人")
    private String releasePerson;

    /**
     * 发布更新时间
     */
//    @ExcelProperty(value = "最近更新时间")
    private LocalDateTime releaseUpdateTime;



    /**
     * 开发状态（0未完成,1已完成）
     */
//    @ExcelProperty(value = "状态", converter = ReviewStatusConverter.class)
    private String developStatus;

    /**
     * 开发参与人
     */
//    @ExcelProperty(value = "参与人")
    private String developPerson;

    /**
     * 开发更新时间
     */
//    @ExcelProperty(value = "最近更新时间")
    private LocalDateTime developUpdateTime;


    /**
     * 产品交付
     */
//    @ExcelProperty(value = "产品交付")
    private String productDeliver;

    /**
     * 设计产品附件
     */
//    @ExcelProperty(value = "产品附件", converter = ListToStringConverter.class)
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> productFile;

    /**
     * ui交付
     */
//    @ExcelProperty(value = "ui交付")
    private String uiDeliver;

    /**
     * ui附件
     */
//    @ExcelProperty(value = "ui附件", converter = ListToStringConverter.class)
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> uiFile;


    /**
     * 交互设计交付
     */
//    @ExcelProperty(value = "交互交付")
    private String designDeliver;

    /**
     * 交互设计附件
     */
//    @ExcelProperty(value = "交互附件", converter = ListToStringConverter.class)
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> designFile;


    /**
     * 资源交付
     */
//    @ExcelProperty(value = "资源交付")
    private String resourceDeliver;

    /**
     * 资源附件
     */
//    @ExcelProperty(value = "资源附件", converter = ListToStringConverter.class)
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> resourceFile;


    /**
     * 设计其他
     */
//    @ExcelProperty(value = "其他")
    private String designRemark;

    /**
     * 设计状态（0未完成,1已完成）
     */
//    @ExcelProperty(value = "状态", converter = ReviewStatusConverter.class)
    private String designStatus;

    /**
     * 设计参与人
     */
//    @ExcelProperty(value = "设计参与人")
    private String designPerson;

    /**
     * 设计更新时间
     */
//    @ExcelProperty(value = "最近更新时间")
    private LocalDateTime designUpdateTime;


    /**
     * 评审总结
     */
//    @ExcelProperty(value = "总结")
    private String reviewSum;

    /**
     * 评审参与人
     */
//    @ExcelProperty(value = "参与人")
    private String reviewPerson;


    /**
     * 评审状态（0未完成,1已完成）
     */
//    @ExcelProperty(value = "状态", converter = ReviewStatusConverter.class)
    private String reviewStatus;

    /**
     * 评审更新时间
     */
//    @ExcelProperty(value = "最近更新时间")
    private LocalDateTime reviewUpdateTime;

    /**
     * 分析投产比
     */
//    @ExcelProperty(value = "分析投产比")
    private String analysisRoi;

    /**
     * 需求依赖
     */

    @TableField(typeHandler =  JacksonTypeHandler.class)
    private List<JSONObject> analysisRely;

//    @ExcelProperty(value = "需求依赖",converter = ListToJSONStringConverter.class)
    @TableField(typeHandler =  JacksonTypeHandler.class)
    private List<JSONObject> analysisRelyName;

    /**
     * 分析状态（0未完成,1已完成）
     */
//    @ExcelProperty(value = "状态", converter = ReviewStatusConverter.class)
    private String analysisStatus;

    /**
     * 分析参与人
     */
//    @ExcelProperty(value = "参与人")
    private String analysisPerson;

    /**
     * 分析更新时间
     */
//    @ExcelProperty(value = "最近更新时间")
    private LocalDateTime analysisUpdateTime;



    /**
     * 品类标签
     */
//    @TableField(typeHandler = StringToListTypeHandler.class)
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> categoryLabel;

    /**
     * 品类标签
     */
//    @ExcelProperty(value = "品类标签", converter = ListToStringConverter.class)
    private List<String> categoryLabelName;

    /**
     * 型号标签
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> modelLabel;


    /**
     * 型号标签
     */
//    @ExcelProperty(value = "型号标签", converter = ListToStringConverter.class)
    private List<String> modelLabelName;

    /**
     * 应用标签
     */
//    @ExcelProperty(value = "应用-版本", converter = ListToStringConverter.class)
    private List<String> applicationVersion;


    /**
     * 品类-型号-版本
     */
//    @ExcelProperty(value = "品类-型号-版本", converter = ListToStringConverter.class)
    private List<String> categoryModelVersion;


    /**
     * 上市更新时间
     */
//    @ExcelProperty(value = "创建时间")
    private LocalDateTime createTime;

    /**
     * 录入附件
     */
//    @ExcelProperty(value = "录入附件", converter = ListToStringConverter.class)
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> enterFile;

    private List<String> enterFileList;

    /**
     * 录入状态（0未完成,2已完成）
     */
//    @ExcelProperty(value = "录入状态", converter = ReviewStatusConverter.class)
    private String enterStatus;

    /**
     * 筛选更新时间
     */
//    @ExcelProperty(value = "筛选更新时间")
    private LocalDateTime filterUpdateTime;

    /**
     * 上市更新时间
     */
//    @ExcelProperty(value = "上市更新时间")
    private LocalDateTime saleUpdateTime;


    /**
     * 调研附件
     */
//    @ExcelProperty(value = "调研附件", converter = ListToStringConverter.class)
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> surveyFile;


    public void setanalysisRelyName(List<JSONObject> analysisRely) {
        this.analysisRelyName = this.analysisRely;
    }

}
